{% extends "opda/base.html" %}

{% block mid %}
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-body">
            <button class="pull-right btn btn-default" data-toggle="modal" data-target="#add_user_dialog">添加用户</button>
                {% if user|length %}
                    <table class="table">
                        <thead>
                            <tr>
                                <th class="col-lg-1">id</th>
                                <th class="col-lg-2">用户名</th>
                                <th class="col-lg-2">email</th>
                                <th class="col-lg-1">用户类型</th>
                                <th class="col-lg-2">备注</th>
                                <th class="col-lg-1">状态</th>
                                <th class="col-lg-2">操作</th>
                            </tr>
                        </thead>
{#                    请点击选择要管理用户：<br/>#}
                        <tbody>
                        {% for u in user %}
                            <tr>
                                <td>{{ u.id }}</td>
                                <td>{{ u.username }}</td>
                                <td><a href="/userinfo/{{ u.id }}">{{ u.email }}</a></td>
                                <td>{{ u.user_type|filter_usertype }}</td>
                                <td>{{ u.description }}</td>
                                <td>{{ u.status }}</td>
                                <td>
                                    {% if u.super_user != 1 %}
                                    <a href="/userdel/{{ u.id }}">删除</a>
                                    {% endif %}
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                {% else %}
                    没有管理的用户
                {% endif %}
            </div>

        </div>
    </div>
    {% include 'opda/block/dialog.html' %}
{% endblock %}
